/////////////////////////////////////////////////////////////////////////////////
// TgcViewer-cpp
// 
// Author: Matias Leone
// 
/////////////////////////////////////////////////////////////////////////////////



#pragma once


//General Includes:
#include <string>
#include <fstream>
using namespace std;

//Project Includes:
#include "TgcViewer/globals.h"
#include "TgcViewer/TgcSceneLoader/TgcTexture.h"
#include "TgcViewer/TgcSceneLoader/TgcParserUtils.h"
#include "TgcViewer/Math/Vector2.h"

//Forward declaration for "TgcViewer/GuiController.h"
namespace TgcViewer {class GuiController;}


namespace TgcViewer
{



/**
* A bitmap font
*/
class TgcFont
{

public:

	TgcFont();
	TgcFont(const TgcFont&);
	~TgcFont();

	/**
	* Load the font from a file.
	* The format used is generated by the program: http://www.codehead.co.uk/cbfg/
	* @param id unique identifier
	* @param bitmapPath Path for the bitmap font
	* @param bitmapPath Path for the csv file containing the font data
	*/
	void loadFromFile(string id, string bitmapPath, string dataPath);

	/**
	* Computes the UV min and max values for the given character
	* @param c
	* @param uvMin the computed min UV values
	* @param uvMax the computed max UV values
	*/
	void getUvExtremes(const char c, Vector2& uvMin, Vector2& uvMax);

	/**
	* Free resources
	*/
	void dispose();

private:

public:

	static const string MICROSOFT_SANS_SERIF_12;
	static const string MICROSOFT_SANS_SERIF_16;
	static const string MICROSOFT_SANS_SERIF_20;
	static const string MICROSOFT_SANS_SERIF_26;


	static const int CHAR_COUNT = 256;

	/**
	* Font id
	*/
	string id;

	/**
	* Font name
	*/
	string name;

	/**
	* Font height
	*/
	int height;

	/**
	* Bitmap font
	*/
	TgcTexture* texture;

	/**
	* Size for each letter cell in the texture
	*/
	Vector2 cellSize;

	/**
	* Width in pixels for each character
	*/
	int charWidth[CHAR_COUNT];



private:


};




}